//
//  MHAskViewController.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/4/28.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHAskViewController.h"
#import "MHAskTableViewCell.h"
#import "MHAskViewModel.h"

@interface MHAskViewController ()
@property(nonatomic, strong)  MHAskViewModel *viewModel;

@end

@implementation MHAskViewController
@dynamic viewModel;

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.tableView reloadData];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView mh_registerNibCell:MHAskTableViewCell.class];
    self.tableView.estimatedRowHeight= 160;
    self.tableView.backgroundColor = MH_MAIN_BACKGROUNDCOLOR_2;
    self.tableView.rowHeight=UITableViewAutomaticDimension;
    [self.viewModel.requstAskCountCommand execute:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (UITableViewCell *)tableView:(UITableView *)tableView dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath{

    return [tableView dequeueReusableCellWithIdentifier:@"MHAskTableViewCell"];
}

- (void)configureCell:(MHAskTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object{
    [cell bindViewModel:object];
}


//-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    return 204;
//}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
